<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "Thing_RecordFile".
 *
 * @property int $ID
 * @property string $Caller
 * @property string $TrunkCaller
 * @property string $EmployeeNumber
 * @property string $Agent
 * @property string $TallTimeStart
 * @property string $TallTimeEnd
 * @property string $Filepath
 * @property string $ShareFilePath
 * @property string $HttpFilePath
 * @property int $ZxCh
 * @property int $TrunkCh
 * @property int $TallWay
 * @property string $BrowseMan
 * @property string $Memo
 * @property string $TallArea
 * @property int $Delflag
 * @property int $Flag
 * @property string $OperNumber
 * @property string $BrowseMans
 * @property string $OperID
 */
class ThingRecordFile extends \yii\db\ActiveRecord
{
    
    public $startDate = '';
    public $endDate = '';
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'Thing_RecordFile';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_crm');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['Caller', 'TrunkCaller', 'EmployeeNumber', 'Agent', 'Filepath', 'ShareFilePath', 'HttpFilePath', 'BrowseMan', 'Memo', 'TallArea', 'OperNumber', 'BrowseMans', 'OperID'], 'string'],
            [['TallTimeStart', 'TallTimeEnd'], 'safe'],
            [['ZxCh', 'TrunkCh', 'TallWay', 'Delflag', 'Flag'], 'integer'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => '唯一编号',
            'Caller' => '呼叫者唯一编号',
            'TrunkCaller' => '长途电话',
            'EmployeeNumber' => '霍佣电话号码',
            'Agent' => '代理人编号',
            'TallTimeStart' => '通话开始时间',
            'TallTimeEnd' => '通话结束时间',
            'ShareFilePath' => '分享文件路径',
            'Filepath' => '文件路径',
            'HttpFilePath' => '网络文件路径',
//            'ZxCh' => 'Zx Ch',
//            'TrunkCh' => 'Trunk Ch',
            'TallWay' => '通话方式',
//            'BrowseMan' => 'Browse Man',
//            'Memo' => 'Memo',
            'TallArea' => '电话归属地',
//            'Delflag' => '电话标志',
            'Flag' => '标志',
//            'OperNumber' => 'Oper Number',
//            'BrowseMans' => 'Browse Mans',
            'progress' => '状态',
        ];
    }
    /**
     * 关联arc_progress
     */
    public function getArcProgress()
    {
        return $this->hasOne(ArcProgress::className(),['thing_recordfile' => 'ID']);
    }
    /**
     * 关联arc_progress
     */
    public function getArcClassify()
    {
        return $this->hasOne(ArcClassify::className(),['thing_recordfile' => 'ID']);
    }
}
